<!--
 * @Descripttion:
 * @Author: Silence
 * @Date: 2023-08-13 16:11:18
 * @LastEditors: Silence
 * @LastEditTime: 2023-08-14 20:32:24
-->
<template>
  <el-dialog
    title="提示"
    :visible="dialogVisible"
    width="40%"
    :before-close="handleClose"
    class="partner"
  >
    <el-form ref="ruleForm" :model="formInline" :rules="rules" label-width="100px" class="demo-ruleForm">
      <el-form-item label="合作商名称" prop="name">
        <el-input v-model="formInline.name" placeholder="请输入" maxlength="10" />
      </el-form-item>
      <el-form-item label="联系人" prop="contact">
        <el-input v-model="formInline.contact" placeholder="请输入" maxlength="10" />
      </el-form-item>
      <el-form-item label="联系电话" prop="mobile">
        <el-input v-model="formInline.mobile" placeholder="请输入" maxlength="11" />
      </el-form-item>
      <el-form-item label="分成比例(%)" prop="ratio">
        <el-input-number v-model="formInline.ratio" placeholder="请输入" controls-position="right" :min="0" :max="100" />
      </el-form-item>
      <el-form-item v-if="!formInline.id" label="账号" prop="account">
        <el-input v-model="formInline.account" placeholder="请输入" maxlength="18" />
      </el-form-item>
      <el-form-item v-if="!formInline.id" label="密码" prop="password">
        <el-input v-model="formInline.password" placeholder="请输入" maxlength="20" />
      </el-form-item>
      <el-form-item>
        <el-button @click="resetForm">取消</el-button>
        <el-button type="primary" @click="submitForm()">确定</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
<script>
export default {
  name: '',
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    formInline: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      ruleForm: {
        name: ''
      }
    }
  },
  computed: {
  },
  created() {
  },
  methods: {
    handleClose() {
      this.resetForm()
    },
    resetForm() {
      this.$emit('clearData', false)
    },
    submitForm() {
      this.$emit('submitForm', false)
    }
  }
}
</script>
<style lang='scss'  >
.partner{
  .is-controls-right{
    width: 100%;
  }
  .el-dialog{
    border-radius: 12px;
  }
  .el-form-item{
    .el-form-item__label{
      font-weight: 400;
    }
  }
}
</style>
